<jsp:include page="plantilla1.jsp" />

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<center>

<c:url var="addUrl" value="/pc02/add" />
<table style="border: 1px solid; width: 500px; text-align:center">
	<thead>
		<tr>
			<th>Numero</th>
			<th>Decripcion</th>
			<th colspan="4">Operaciones</th>
		</tr>
	</thead>
	<tbody>
	<c:forEach items="${destinos}" var="destino">
			<c:url var="editUrl" value="/pc02/update?numero=${destino.id}" />
			<c:url var="deleteUrl" value="/pc02/delete?numero=${destino.id}" />
			<c:url var="getUrl" value="/pc02/get?id=${destino.id}" />
		<tr>
			<td><c:out value="${destino.id}" /></td>
			<td><c:out value="${destino.descripcion}" /></td>
			<td><a href="${editUrl}">Edit</a></td>
			<td><a href="${deleteUrl}">Delete</a></td>
			<td><a href="${addUrl}">Add</a></td>
			<td><a href="${getUrl}">Get</a></td>
		</tr>
	</c:forEach>
	</tbody>
</table>

<c:if test="${empty destinos}">
	There are currently no persons in the list. <a href="${addUrl}">Add</a> a person.
</c:if>

</center>

<jsp:include page="plantilla2.jsp" />